import re
import requests
from bs4 import BeautifulSoup

def getHTML(url):
    headers = {
                'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) '
                'AppleWebKit/537.36 (KHTML, like Gecko)'
                ' Chrome/68.0.3423.2 Safari/537.36'
    }
    try:
        r = requests.get(url,headers=headers,timeout=30)
        r.raise_for_status()
        r.encoding = r.apparent_encoding
        return r.text
    except:
        print('gethtml wrong')

def getData(html):
    soup = BeautifulSoup(html,'html.parser')
    tbody = soup.find_all('tbody')
    print(tbody)
    return

def Dataprocess():
    return 0

if __name__ == '__main__':
    url = 'https://www.wanplus.com/lol/teamstats'
    html = getHTML(url)
    getData(html)
